package cn.huiyunche.driver.schedule;

import cn.huiyunche.base.service.interfaces.impl.DWaybillServiceImpl;
import cn.huiyunche.base.service.utils.DateUtils;
import org.joda.time.DateTime;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class DeleteOrdersQuartzCluster implements Job, Serializable {
    private static final Logger logger = LoggerFactory.getLogger(DeleteOrdersQuartzCluster.class);
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        logger.info("jbo start: delete orders job time: {}", new DateTime().toString(DateUtils.YYYY_MM_DD_HH_MM_SS_SSS));
        DWaybillServiceImpl dWaybillServiceImpl = QuartzClusterFactory.getDWaybillServiceImpl();
        dWaybillServiceImpl.deleteOrder();
        logger.info("jbo end: delete orders job time: {}", new DateTime().toString(DateUtils.YYYY_MM_DD_HH_MM_SS_SSS));
    }
}
